﻿using System;
using System.Collections.Generic;
using System.Text;

public static class GarageVehicleAllocator
{
    private const int m_NumOfVehiclesTypes = 3;

    public enum eVehicleType
    {
        Car = 0,
        Motorcycle,
        Truck
    }

    public static Vehicle AllocateVehicle(eVehicleType i_VechileType)
    {
        Vehicle result = null;

        switch (i_VechileType)
        {
            case eVehicleType.Car:
                result = new Car();
                break;
            case eVehicleType.Motorcycle:
                result = new Motorcycle();
                break;
            case eVehicleType.Truck:
                result = new Truck();
                break;
            default:
                break;
        }

        return result;
    }

    public static List<string> GetListOfVehicleTypes()
    {
        List<string> result = new List<string>();

        for (int CurrentVehicleTypeIndex = 0; CurrentVehicleTypeIndex < m_NumOfVehiclesTypes; CurrentVehicleTypeIndex++)
        {
            eVehicleType CurrenteVehicleType = (eVehicleType)CurrentVehicleTypeIndex;
            result.Add(CurrenteVehicleType.ToString());
        }

        return result;
    }
}
